<?php
class Ddup_Featured_Block_Adminhtml_Products_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
	public function __construct()
    {
        parent::__construct();
        $collection = Mage::getModel('featured/products')->getResourceCollection();
        $this->setCollection($collection);
    }
    
	protected function _prepareColumns()
    {
        $this->addColumn('featured_products_id', array(
            'header'    => Mage::helper('featured')->__('ID'),
            'align'     =>'right',
            'width'     => '50px',
            'index'     => 'featured_products_id',
        ));

        $this->addColumn('title', array(
            'header'    => Mage::helper('featured')->__('Title'),
            'align'     =>'left',
            'index'     => 'title',
        ));

        $this->addColumn('show_qty', array(
            'header'    => Mage::helper('featured')->__('Show Qty'),
            'align'     => 'left',
            'width'     => '50px',
            'index'     => 'show_qty',
        ));

        $this->addColumn('is_random', array(
            'header'    => Mage::helper('featured')->__('Is Random'),
            'align'     => 'left',
            'width'     => '50px',
            'index'     => 'is_random',
            'type'      => 'options',
        	'options'   => array(
                1 => 'Yes',
                0 => 'No',
            ),
        ));

        $this->addColumn('created', array(
            'header'    => Mage::helper('featured')->__('Created'),
            'align'     => 'left',
            'width'     => '120px',
            'type'      => 'date',
            'index'     => 'created',
        ));
        
        return parent::_prepareColumns();
    }
    
    public function getRowUrl($row)
    {
        return $this->getUrl('*/*/edit', array('id' => $row->getFeaturedProductsId()));
    }

}
